home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Dictionary.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  4.4 KB  |  139 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Dictionary.p
  3.  
  4.      Contains:    Dictionary Manager Interfaces
  5.  
  6.      Version:    Technology:    System 7
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1992-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT Dictionary;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __DICTIONARY__}
  28. {$SETC __DICTIONARY__ := 1}
  29.  
  30. {$I+}
  31. {$SETC DictionaryIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __MACTYPES__}
  35. {$I MacTypes.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __FILES__}
  38. {$I Files.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN MAC68K}
  44. {$LibExport+}
  45.  
  46.  
  47.  
  48. CONST
  49.                                                                 {  Dictionary data insertion modes  }
  50.     kInsert                        = 0;                            {  Only insert the input entry if there is nothing in the dictionary that matches the key.  }
  51.     kReplace                    = 1;                            {  Only replace the entries which match the key with the input entry.  }
  52.     kInsertOrReplace            = 2;                            {  Insert the entry if there is nothing in the dictionary which matches the key, otherwise replaces the existing matched entries with the input entry.  }
  53.  
  54. { This Was InsertMode }
  55.  
  56. TYPE
  57.     DictionaryDataInsertMode            = INTEGER;
  58.  
  59. CONST
  60.                                                                 {  Key attribute constants  }
  61.     kIsCaseSensitive            = $10;                            {  case sensitive = 16         }
  62.     kIsNotDiacriticalSensitive    = $20;                            {  diac not sensitive = 32     }
  63.  
  64.                                                                 {  Registered attribute type constants.     }
  65.     kNoun                        = -1;
  66.     kVerb                        = -2;
  67.     kAdjective                    = -3;
  68.     kAdverb                        = -4;
  69.  
  70. { This Was AttributeType }
  71.  
  72. TYPE
  73.     DictionaryEntryAttribute            = SInt8;
  74. { Dictionary information record }
  75.     DictionaryInformationPtr = ^DictionaryInformation;
  76.     DictionaryInformation = RECORD
  77.         dictionaryFSSpec:        FSSpec;
  78.         numberOfRecords:        SInt32;
  79.         currentGarbageSize:        SInt32;
  80.         script:                    ScriptCode;
  81.         maximumKeyLength:        SInt16;
  82.         keyAttributes:            SInt8;
  83.     END;
  84.  
  85.     DictionaryAttributeTablePtr = ^DictionaryAttributeTable;
  86.     DictionaryAttributeTable = PACKED RECORD
  87.         datSize:                UInt8;
  88.         datTable:                ARRAY [0..0] OF DictionaryEntryAttribute;
  89.     END;
  90.  
  91. FUNCTION InitializeDictionary({CONST}VAR theFsspecPtr: FSSpec; maximumKeyLength: SInt16; keyAttributes: SInt8; script: ScriptCode): OSErr;
  92.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  93.     INLINE $303C, $0500, $AA53;
  94.     {$ENDC}
  95. FUNCTION OpenDictionary({CONST}VAR theFsspecPtr: FSSpec; accessPermission: SInt8; VAR dictionaryReference: SInt32): OSErr;
  96.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  97.     INLINE $303C, $0501, $AA53;
  98.     {$ENDC}
  99. FUNCTION CloseDictionary(dictionaryReference: SInt32): OSErr;
  100.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  101.     INLINE $303C, $0202, $AA53;
  102.     {$ENDC}
  103. FUNCTION InsertRecordToDictionary(dictionaryReference: SInt32; key: Str255; recordDataHandle: Handle; whichMode: DictionaryDataInsertMode): OSErr;
  104.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  105.     INLINE $303C, $0703, $AA53;
  106.     {$ENDC}
  107. FUNCTION DeleteRecordFromDictionary(dictionaryReference: SInt32; key: Str255): OSErr;
  108.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  109.     INLINE $303C, $0404, $AA53;
  110.     {$ENDC}
  111. FUNCTION FindRecordInDictionary(dictionaryReference: SInt32; key: Str255; requestedAttributeTablePointer: DictionaryAttributeTablePtr; recordDataHandle: Handle): OSErr;
  112.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  113.     INLINE $303C, $0805, $AA53;
  114.     {$ENDC}
  115. FUNCTION FindRecordByIndexInDictionary(dictionaryReference: SInt32; recordIndex: SInt32; requestedAttributeTablePointer: DictionaryAttributeTablePtr; VAR recordKey: Str255; recordDataHandle: Handle): OSErr;
  116.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  117.     INLINE $303C, $0A06, $AA53;
  118.     {$ENDC}
  119. FUNCTION GetDictionaryInformation(dictionaryReference: SInt32; VAR theDictionaryInformation: DictionaryInformation): OSErr;
  120.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  121.     INLINE $303C, $0407, $AA53;
  122.     {$ENDC}
  123. FUNCTION CompactDictionary(dictionaryReference: SInt32): OSErr;
  124.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  125.     INLINE $303C, $0208, $AA53;
  126.     {$ENDC}
  127.  
  128.  
  129. {$ALIGN RESET}
  130. {$POP}
  131.  
  132. {$SETC UsingIncludes := DictionaryIncludes}
  133.  
  134. {$ENDC} {__DICTIONARY__}
  135.  
  136. {$IFC NOT UsingIncludes}
  137.  END.
  138. {$ENDC}
  139.